﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading;
using System.Windows.Input;

using DanielVaughan.ComponentModel;
using DanielVaughan.Windows;

namespace CalciumTemplateApp.Views.Examples
{
	public class CompositeValidationViewModel : UserViewModel, ICompositeViewModel
	{
		public CompositeValidationViewModel() : base("composite validation")
		{
			/* Intentionally left blank. */
		}

		readonly IEnumerable<ViewModelBase> childViewModels
			= new ObservableCollection<ViewModelBase>
		            {
		                new PreventsNavigationViewModel(),
 						new ValidationPivotViewModel(),
						new PreventsNavigationViewModel()
		            };

		public IEnumerable<ViewModelBase> ChildViewModels
		{
			get
			{
				return childViewModels;
			}
		}

		ViewModelBase selectedViewModel;

		public ViewModelBase SelectedViewModel
		{
			get
			{
				return selectedViewModel;
			}
			set
			{
				Assign(() => SelectedViewModel, ref selectedViewModel, value);
			}
		}

		public void ActivateViewModel(ViewModelBase viewModel)
		{
			SelectedViewModel = viewModel;
		}
	}
}
